//网站门户组件
import Main from '@/pages/Main.vue'
import Home from '@/pages/home/Home.vue'
import JobsPage from '@/pages/jobs/JobsPage.vue'
import TalentsPage from '@/pages/talents/TalentsPage.vue'
import SchoolsPage from '@/pages/schools/SchoolsPage.vue'
// import RecruitmentPage from '@/pages/recruitment/RecruitmentPage.vue'
// import JobsPage from '@/pages/jobs/JobsPage.vue'

// 登录注册主要组件
import Sign from '@/pages/sign-in/sign/Sign.vue'
import EnterprisInfor from '@/pages/sign-in/sign-information/EnterprisInfor.vue'
import PersonInfor from '@/pages/sign-in/sign-information/person/PersonInfor.vue'
import Login from '@/pages/sign-in/login/Login.vue'
import ResetPassword from '@/pages/sign-in/reset-password/ResetPassword.vue'

// 企业中心组件
import EnterpriseMain from '@/pages/enterprise-center/EnterpriseMain.vue'
import EnterpriseCenter from '@/pages/enterprise-center/center/Center.vue'
import EnterpriseHome from '@/pages/enterprise-center/home/EnterpriseHome.vue'
import EditData from '@/pages/enterprise-center/center/edit-data/EditData.vue'
import MyMessage from '@/pages/enterprise-center/message/MyMessage.vue'
import JobManage from '@/pages/enterprise-center/job-manage/JobManage.vue'
import ResumeManage from '@/pages/enterprise-center/resume-manage/ResumeManage.vue'
import PublishJob from '@/pages/enterprise-center/job-manage/publish-job/PublishJob.vue'

// Main子组件的路由写在这
export const mainRouter = {
    path: '/',
    name: 'main',
    redirect: '/Home',
    component: Main,
    children: [{
        path: '/Home',
        title: '首页',
        meta: {
            title: '首页',
        },
        name: 'home',
        component: Home,
    },{
        path: '/Jobs',
        title: '找工作',
        meta: {
            title: '找工作',
        },
        name: 'Jobs',
        component: JobsPage,
    },{
        path: '/TalentsPage',
        title: '找人才',
        meta: {
            title: '找人才',
        },
        name: 'TalentsPage',
        component: TalentsPage,
    },{
        path: '/School',
        title: '学校',
        meta: {
            title: '学校',
        },
        // name: 'TalentsPage',
        // component: TalentsPage,
    },{
        path: '/General ',
        title: '招聘简章',
        meta: {
            title: '招聘简章',
        },
        // name: 'TalentsPage',
        // component: TalentsPage,
    },{
        path: '/News',
        title: '职场资讯',
        meta: {
            title: '职场资讯',
        },
        // name: 'TalentsPage',
        // component: TalentsPage,
    },]
};

// 登录/注册
export const signRouters = [
    {
        path: '/Sign',
        meta: {
            title: '注册',
        },
        name: 'Sign',
        component: Sign,
    },  {
        path: '/EnterprisInfor',
        meta: {
            title: '企业信息',
        },
        name: 'EnterprisInfor',
        component: EnterprisInfor,
    }, {
        path: '/PersonInfor',
        meta: {
            title: '个人信息',
        },
        name: 'PersonInfor',
        component: PersonInfor,
    },{
        path: '/PersonStep',
        name: 'PersonStep',
        component: resolve => {
            require(['@/pages/sign-in/sign-information/person/PersonStep.vue'], resolve)
        }
    }, {
        path: '/Login',
        meta: {
            title: '登录',
        },
        name: 'Login',
        component: Login,
    }, {
        path: '/ResetPassword',
        meta: {
            title: '重置密码',
        },
        redirect: '/resetBy/phone-step01',
        name: 'ResetPassword',
        component: ResetPassword,
        children: [
            {
                path: '/resetBy/phone-step01',
                name: 'phone-step01',
                component: resolve => {
                    require(['@/pages/sign-in/reset-password/ByPhone01.vue'], resolve)
                }
            },{
                path: '/resetBy/phone-step02',
                name: 'phone-step02',
                component: resolve => {
                    require(['@/pages/sign-in/reset-password/ByPhone02.vue'], resolve)
                }
            },{
                path: '/resetBy/email-step01',
                name: 'email-step01',
                component: resolve => {
                    require(['@/pages/sign-in/reset-password/ByEmail01.vue'], resolve)
                }
            },{
                path: '/resetBy/email-step02',
                name: 'email-step02',
                component: resolve => {
                    require(['@/pages/sign-in/reset-password/ByEmail02.vue'], resolve)
                }
            }
            ]
    },
];

// 企业中心
export const enterpriseRouter = {
    path: '/Enterprise',
    name: 'Enterprise',
    redirect: '/Enterprise/center',
    component: EnterpriseMain,
    children: [
        {
            path: '/Enterprise/center',
            meta: {
                title: '企业中心',
            },
            name: 'enterprise-center',
            component: EnterpriseCenter,
        },
        {
            path: '/Enterprise/center/edit',
            meta: {
                title: '账号设置',
            },
            name: 'edit-enterprise-data',
            component: EditData,
        },
        {
            path: '/Enterprise/center/message',
            meta: {
                title: '我的消息',
            },
            name: 'enterprise-message',
            component: MyMessage,
        },
        {
            path: '/Enterprise/job/manage',
            meta: {
                title: '职位管理',
            },
            name: 'job-manage',
            component: JobManage,
        },  {
            path: '/Enterprise/resume/manage/publish',
            meta: {
                title: '发布职位',
            },
            name: 'publish-job',
            component: PublishJob,
        },
         {
            path: '/Enterprise/resume/manage',
            meta: {
                title: '简历管理',
            },
            name: 'resume-manage',
            component: ResumeManage,
        }
    ]
};

// 其他没有从属关系的页面
export const otherRouters = [
    {
        path: '/Enterprise/home',
        name: 'enterprise-home',
        meta: {
            title: '公司主页'
        },
        component: EnterpriseHome
    }
]


export const routes = [
    mainRouter,
    enterpriseRouter,
    ...signRouters,
    ...otherRouters,
];
